package com.hj.enroll.service;

import com.hj.enroll.mapper.UserMapper;
import com.hj.enroll.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    @Override
    public List<User> findAllUser() {
        List<User> users = userMapper.lookUser();
        return users;
    }

    @Override
    public int insertUser(User user) {
        int i = userMapper.addUser(user);
        return i;
    }

    @Override
    public int updateUser(User user) {
        return 0;
    }

    @Override
    public int addComment(String name, String comment) {
        return 0;
    }

    @Override
    public User searchUser(String name) {
        User user = userMapper.searchUser(name);
        return user;
    }

    @Override
    public int deleteUser(String name) {
        int i = userMapper.deleteUser(name);
        return i;
    }
}
